<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>送好礼</title>
    <link rel="stylesheet" type="text/css" href="css/css/stylesheets/defaultcss.css">
    <link rel="stylesheet" type="text/css" href="css/css/stylesheets/index.css">
    <script src="js/flex.js"></script>
    <script src="js/jquery-1.9.1.min.js"></script>
</head>

<body>
    <div class="index_content">
        <div class="banner1">
            <img src="./img/banner1.png" alt="">
        </div>
        <div class="position_box">
            <div class="banner2">
                <a href="https://acts.richinhz.com/rui_cheng_integral_web/cgg"><img src="./img/banner2.png" alt=""></a>
            </div>
            <div class="linebox ">
                <img src="./img/line.png" alt="">
            </div>
            <ul class="tabList">
                <li class="">
                    <a href="./index.html">
                        <div class="icon icon1">
                        </div>
                        <div class="text text1">
                            精选
                        </div>
                    </a>
                </li>
                <li class="">
                    <a href="./coupon.html">
                        <div class="icon icon5">
                        </div>
                        <div class="text text5">
                            优惠券
                        </div>
                    </a>
                </li>
                <li class="">
                    <a href="./education.html">
                        <div class="icon icon2">
                        </div>
                        <div class="text text2">
                            教育
                        </div>
                    </a>
                </li>
                <li class="">
                    <a href="./liren.html">
                        <div class="icon icon3">
                        </div>
                        <div class="text text3">
                            丽人
                        </div>
                    </a>
                </li>
                <li class="active">
                    <a href="javascript:void(0);">
                        <div class="icon icon4">
                        </div>
                        <div class="text text4">
                            信用卡
                        </div>
                    </a>
                </li>
            </ul>
            <ul class="equity_list" id="equity_list">
            </ul>
        </div>
    </div>

</body>

</html>

<script type="text/javascript">
    $.ajax({
        url: 'https://acts.richinhz.com/rui_cheng_integral_web/staticWeb/prizeList', //请求访问地址
        dataType: 'json', //访问格式，如：json、html等
        timeout: 10000, //请求访问时间
        data: {
            actId: 9
        },
        contentType: false,
        processData: true,
        type: 'get', //请求访问方式，如post、get
        success: function (data) {
            console.log(data)
            var data = data.data
            var equity_list_msg = '';
            var nowArr = []
            for (var i = 0; i < data.length; i++) {
                if (data[i].template.instruction == '4') {
                    nowArr.push(data[i]);
                    nowArr = nowArr.sort(compare('template'))
                }
            }

            function compare(property) {
                return function (a, b) {
                    var value1 = a[property].details;
                    var value2 = b[property].details;
                    return value1 - value2;
                }
            }
            for (var i = 0; i < nowArr.length; i++) {
                equity_list_msg +=
                    '<li>         ' +
                    '    <a href="' + nowArr[i].couponUrl + '">    ' +
                    '        <img src="https://pics.richinhz.com/' + nowArr[i].template.icon +
                    '" alt="">                                                                        ' +
                    '    </a>                                                      ' +
                    '</li>       '
            }
            $("#equity_list").append(equity_list_msg)
        },
    });
    // var equity_list = [{
    //     "image": "./img/card/c1.png",
    //     "link": 'https://web.u51.com/luban-project-757/index.html?channel=swhz_181024_weiyi_dk&notwakeup=false'
    // }, {
    //     "image": "./img/card/c2.png",
    //     "link": 'https://yun.haodai.com/To/c/bank_id/13/card_id/12666/ref/hd_11021334'
    // }, {
    //     "image": "./img/card/c3.png",
    //     "link": 'https://ecentre.spdbccc.com.cn/creditcard/indexActivity.htm?data=ZF2780083&itemcode=0000000192'
    // }, {
    //     "image": "./img/card/c4.png",
    //     "link": 'https://xyk.cebbank.com/cebmms/apply/ps/card-list.htm?pro_code=FHTG067632SA0833CYJR'
    // }, {
    //     "image": "./img/card/c5.png",
    //     "link": 'https://creditcard.cmbc.com.cn/wsv2/?etr=xGIVxp5kuWkcrZ/s/sZK5IsOfGXr4OZQZ5Ra1i3hSOAENUaz9Yw0yejR0dICixJsesgEtX1o+1XvQCy61SVFTkt15UuuKCn67+YIsJ7hBnBSM6SaI62xBQqVxi7VyxeHndh5fyITluSSj8RTytS4dC1PKzHpCObXGthj4Y2uH65qnnqrPVEYIeq+hqLlNb3NQAFWqDKr7XOi+PiYvsFd6yYsa0bOnxGuzoYEG7MqvuMmO396UP3lJynyycsvGPUeR+nmCprllJ8+oQRp1iibU0xOwaWu83w9mDsf5AU/qncO34tEOrey08Db7PSX2n9NB+Zs9/omtAwsyOrMSYvdpxHLaonlHoDOevpFDVbZSzKtH8Z0cpo3aqb7zbvfd3FK2AX8388BV33IXOs+Kc06DgcENRdhjRPW30rv91x16rVigk4lzrtuq15QW+V1rEqtmFUfcwsKrO4LfOKhX2H9Mcd38u5CYG95JUkzOWNUBMlIVTWVXfUyEQ8KIzODtAmY'
    // }, {
    //     "image": "./img/card/c6.png",
    //     "link": 'https://yun.haodai.com/To/c/bank_id/9/ref/hd_11021334'
    // }];
    // var equity_list_msg = ''
    // equity_list.forEach(function (item, index) {
    //     equity_list_msg +=
    //         '<li>                                                                                                           ' +
    //         '    <a href="' + item.link + '">    ' +
    //         '        <img src="' + item.image +
    //         '" alt="">                                                                        ' +
    //         '    </a>                                                                                                       ' +
    //         '</li>                                                                                                          '
    // }, this);
    // $("#equity_list").append(equity_list_msg)
</script>